//
//  CommentDetail.m
//  ShanMei
//
//  Created by huazi on 15/4/7.
//  Copyright (c) 2015年 huazi. All rights reserved.
//

#import "CommentDetail.h"

@implementation CommentDetail
- (instancetype)initWithDic:(NSDictionary *)dic {
    if (self =[super init]) {
        _userName =[dic objectForKey:@"userName"];
        _insertDate =[dic objectForKey:@"insertDate"];
        _tabsName =[dic objectForKeyNotNull:@"tabsName"];
        _score =[dic objectForKeyNotNull:@"score"];
        _content =[dic objectForKeyNotNull:@"content"];
        _picUrl1 =[dic objectForKeyNotNull:@"picUrl1"];
        _picUrl2 =[dic objectForKeyNotNull:@"picUrl2"];
        _picUrl3 =[dic objectForKeyNotNull:@"picUrl3"];
        if (![NSString isEmpty:_picUrl1]) {
            _arrPics =[[NSMutableArray alloc] init];
            [_arrPics addObject:_picUrl1];
        }
        if (![NSString isEmpty:_picUrl2]) {
            [_arrPics addObject:_picUrl2];
        }
        if (![NSString isEmpty:_picUrl3]) {
            [_arrPics addObject:_picUrl3];
        }
    }
    return self;
}
@end
